<template>
  <div id="App">
    <h1> count：{{ count }}</h1>
    <button @click="handler">+1</button>
    <children></children>
  </div>
</template>
<script>
import eventBus from "@/utils/eventBus";
import Children from "@/components/children.vue";

export default {
  name: "App",
  components: {Children},
  data() {
    return {
      count: 0
    }
  },
  methods: {
    handler() {
      this.count++
      eventBus.emit("changeCount", this.count)
    }
  }

}
</script>
<style lang="less">

</style>
